/*
 * @Description: 你的代码我的心
 * @Author: GGB
 * @Date: 2021-12-02 09:21:48
 * @LastEditors: GGB
 * @LastEditTime: 2021-12-08 05:51:00
 */
export default {
  // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
  ssr: false,

  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'ggb学习nuxt笔记',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'ggb学习nuxt笔记' },
      { hid: 'keywords', name: 'keywords', content: 'ggg,学习nuxt,' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: ['assets/main.css', 'element-ui/lib/theme-chalk/index.css'],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    {
      src: '~plugins/ElementUI',
      ssr: true
    }
  ],
  // loading
  loading: {
    color: '#ff4500',
    duration: 500
  },

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
  ],
  // env https://www.nuxtjs.cn/api/configuration-env
  env: {
    baseUrl: process.env.PATH_TYPE === 'dev' ? 'http://localhost:3333/api' : 'https://api.sunofbeach.net/shop'
  },

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    '@nuxtjs/axios',
  ],
  axios: {
    proxy: true,
    prefix: '/api/',
    credentials: true
  },
  proxy: {
    '/api/': {
      target: 'https://api.sunofbeach.net/shop',
      pathRewrite: {
        '^/api/': '/',
        changeOrigin: true
      }
    }
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    vendor: ['axios'],
  },
  //route
  router: {

  }
}
